const RecorderManager = wx.getRecorderManager();
let recordermanageurl;
RecorderManager.onStop(res => {
  console.log(res);
  recordermanageurl = res.tempFilePath;
});
const InnerAudioContext = wx.createInnerAudioContext();
Page({
  data: {
    array: ["美国", "中国", "巴西", "日本"],
    list: [
      {
        id: 1,
        title: "大禹治水",
        keywords: "神话故事-大禹治水.发生在炎黄之后,尧舜时代."
      },
      {
        id: 2,
        title: "悟空传2",
        keywords: "这是说明啊啊啊啊 啊"
      }
    ]
  },
  bindPickerChange: function(e) {
    console.log("picker发送选择改变，携带值为", e.detail.value);
    this.setData({
      index: e.detail.value
    });
  },
  startAudio() {
    RecorderManager.start();
  },
  topAudio() {
    RecorderManager.stop();
  },
  shiting() {
    InnerAudioContext.src = recordermanageurl;
    InnerAudioContext.play();
  },
  tingzhi() {
    InnerAudioContext.stop();
  }
});
